home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / asmutil / uasm.zip / U-ASM.DOC < prev    next >
Text File  |  1986-04-10  |  22KB  |  629 lines

  1. .R:Q
  2. .H:
  3. .H:
  4. .H:...UASM - Universal Cross Assembler...
  5. .H:
  6. .F:
  7. .F:...Custom Computer Consultants        $$$                  10 April 1986...
  8. .F:
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.                         UASM - Universal Cross Assembler
  40.  
  41.  
  42.  
  43.                                       8051
  44.  
  45.                                       6805
  46.  
  47.                                        Z8
  48.  
  49.  
  50.  
  51.  
  52.  
  53.                                                         10 April 1986
  54. 
  55.                               1. INTRODUCTION
  56.     
  57.     General Description
  58.     
  59.     UASM  is  a  program which facilitates the writing of assemblers for single 
  60.     chip microcomputers.  It has only the rudimentary features of decoding  the 
  61.     instruction  set  and a few pseudo operations.  It is intended for programs 
  62.     that can be contained in a single  file  which  is  typical  of  the  short 
  63.     programs written for these types of processors.  In particular there are no 
  64.     provisions  for  macros  or include files.  The performance when generating 
  65.     both an object file and a listing is about 700 statements per  minute  when 
  66.     using a hard disk.
  67.     
  68.     
  69.     Program Execution
  70.     
  71.     UASM has several different names depending on which processor it has been 
  72.     built for.  It is invoked by entering the name of the program ( asm05 for 
  73.     the 6805 version) followed by the name of the source file followed by the 
  74.     option switches.  The allowable options are at the present time are :
  75.     
  76.         o       creates an object output file from the name of the source file 
  77.                 and the extension ".HEX".
  78.  
  79.         l       creates a listing file from the name of the source file and the 
  80.                 extension ".LST".
  81.  
  82.         n       suppress the listing function.
  83.  
  84.     If the l and the n options are both absent then the  listing  goes  to  the 
  85.     terminal.  If  no source file is specified then the input is taken from the 
  86.     terminal and ouput is written to the terminal.  The  assembler  is  entered 
  87.     directly  into  pass  2 with no symbol table.  This feature was mainly used 
  88.     for program debugging and has not been removed.  
  89.  
  90.  
  91.     Program Operation
  92.  
  93.     UASM is a two pass assembler.  On the first pass it reads  statements  from 
  94.     the  input file and builds a symbol table.  On the second pass it reads the 
  95.     statements from the input file and creates the object output file  and  the 
  96.     listing  file  using  the  symbol table information it created in the first 
  97.     pass.  At the end of the listing file the content of the  symbol  table  is 
  98.     added.  The  object ouput is in Intel Hex format with a maximum of 34 bytes 
  99.     to a record.  When displayed on  an  80  column  screen  the  records  will 
  100.     exactly  fill  on  line.  The  listing  file is formatted with 55 statement 
  101.     lines and four header lines per page and assumes 11 inch pages and 6  lines 
  102.     per inch.  This leaves a combined top and bottom margin of seven lines.  
  103.  
  104.     
  105.     Files
  106.  
  107.     The UASM system was written in the C language and consists of the following 
  108.     set of files :
  109.  
  110.                 STDIO.H         Standard I/O Header File
  111.                 UASM.H          UASM header file; same for all versions
  112.  
  113.                 UASM.C          Source code for the part common to all the
  114.                                 versions.
  115.                 51SYM.C         Symbols and processing routines for the 8051.
  116.                 6805SYM.C       Symbols and processing routines for the 6805.
  117.                 Z8SYM.C         Symbols and processing routines for the Z8.
  118.     
  119.                 ASM51.EXE       8051 assembler execution file.
  120.                 ASM05.EXE       6805 assembler execution file.
  121.                 ASMZ8.EXE       Z8 assembler execution file.
  122.  
  123.                 51VAL.MAC       8051 validation/example file.
  124.                 6805VAL.MAC     6805 validation/example file.
  125.                 Z8VAL.MAC       Z8 validation/example file.
  126.  
  127.                 U-ASM.DOC       This File
  128.     
  129. 
  130.                               2. Assembler Conventions
  131.       
  132.     
  133.     Statement Format
  134.  
  135.     The  primary  component  in  an assembly language program is the statement, 
  136.     which  consists  of  an  instruction  and  its  operands.  The  instruction 
  137.     specifies  and  action  to be taken and the operands specify the data to be 
  138.     acted upon.  An assembly language statement can include four fields: 
  139.  
  140.                 Statement Labels
  141.  
  142.                 Instructions or Pseudo Operations
  143.  
  144.                 Operands
  145.  
  146.                 Comments
  147.  
  148.     The statement label and comments are optional.  The statement may have zero 
  149.     or more operands depending on the instruction.  The fields in  a  statement 
  150.     are  separated  from  each  other  by  one  or more delimiters.  Delimiters 
  151.     include spaces, tabs, commas, semi-colons, colons, newlines.  To accomodate 
  152.     various programming styles the rules on delimiters  are  very  relaxed.  In 
  153.     general  blanks separate fields and commas separate operands.  Colons after 
  154.     labels are optional and delimiters for the comment field are also optional.
  155.     This can lead to problems with evaluating expressions if the first word  in 
  156.     a comment happens to be a recognizeable symbol.  Therefore use of a comment 
  157.     delimiter  (";")  is  strongly  recommended.  Comments may occupy an entire 
  158.     line when the first character is either a semi-colon (";") or  an  asterisk 
  159.     ("*").  
  160.  
  161.     Program Labels and Identifiers
  162.  
  163.     A  program  label  is any identifier that begins in the first position of a 
  164.     line.  An identifier is any string of alphanumeric characters  whose  first 
  165.     character  is  alphabetic.  A  program label may be followed by an optional 
  166.     colon.  A character is alphbetic if it is either upper case or lower  case.
  167.     A  character  is  alphanumeric  if  it  is  either alphabetic or numeric or 
  168.     underscore.  
  169.  
  170.  
  171.  
  172.         upper case =  { A B C D E F G H I J K L M N O P Q R S T U V W X Y Z }
  173.     
  174.         lower case =  { a b c d e f g h i j k l m n o p q r s t u v w x y z }
  175.  
  176.         numeric = { 0 1 2 3 4 5 6 7 8 9 }
  177.  
  178.         alphabetic = { upper case } or { lower case }
  179.  
  180.         alphanumeric = { alphabetic } or { numeric } or { _ }
  181.  
  182.         identifier = { alphabetic }  followed by one or more { alphanumeric } 
  183.  
  184.         program label = identifier in first position of a line
  185.  
  186.  
  187.  
  188.     Each time an identifier is used it must be written in exactly the same  way 
  189.     or  it  will  be considered a different identifier.  Identifiers may be any 
  190.     length but only 31 characters are significant.  The following are valid and 
  191.     unique identifiers: 
  192.     
  193.                 begin                   BEGIN                   bEgIn
  194.  
  195.                 label12                 LABEL12                 lAbEl12
  196.  
  197.                 group1:                 GROUP1:                 gRoUp1:
  198.  
  199.  
  200.     In addition to their statement labeling function identifiers also represent 
  201.     constants and variable names.  They may even define a value for the symbols 
  202.     which  represent  instructions and pseudo operations,  and no conflict will 
  203.     result.  
  204.  
  205.     Instructions
  206.  
  207.     The instruction field contains a mnemonic symbol which specifies one of the 
  208.     processors instructions or a pseudo operation.  A pseudo  operation  is  an 
  209.     instruction  to the assembler to perform some action.  Instructions must be 
  210.     preceeded and followed by one or more spaces  to  separate  them  from  the 
  211.     label   and  operand  fields.   Pseudo  operations  are  described  in  the 
  212.     appendicies 
  213.  
  214.     Operands
  215.  
  216.     Depending on the instruction there can  be  zero,  one  or  more  operands.
  217.     Multiple operands are separated from each other by commas.  Operands supply 
  218.     the  information  the  instruction  needs  to  carry out its operation.  An 
  219.     operand can be : 
  220.  
  221.                 Immediate data
  222.  
  223.                 The address of a location from which data is to be taken
  224.